<template>
  <!-- 搜索栏 -->
  <div class="container" @click="gotoDetails">
    <div class="search">
      <div class="icon">
        <van-icon name="search" color="#0e35b9" size="20" />
      </div>
      <div class="enterInformation">
        <input type="text" placeholder="输入商品名称" v-model="searchValue" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Search",
  data() {
    return {
      searchValue: "",
    };
  },
  methods: {
    gotoDetails() {
      this.$router.push("searchDetail");
    },
  },
};
</script>

<style scoped lang="less">
.container {
  background: #ffffff;
  padding: 5px 10px;

  .search {
    box-sizing: border-box;
    background: #f7f8fa;
    width: 100%;
    height: 40px;
    line-height: 40px;
    justify-content: space-around;
    border-radius: 20px;
    align-items: center;
    display: flex;

    .icon {
      flex: 1;
      text-align: center;
      margin-left: 5px;
    }

    .enterInformation {
      flex: 9;

      input {
        width: 90%;
        background: #f7f7f7;
        font-size: 14px;
      }
    }
  }
}
</style>
